import directives from './directives'
import permissionRoutes from './router/permission'

export default (app: any, router: any) => {
  //注册指令
  directives(app)

  // 注册路由
  const permissionFlg = import.meta.env.VITE_APP_PLUGINS.includes('permission')
  if (!permissionFlg) {
    const privateRoutes = [...permissionRoutes]
    privateRoutes.forEach((item) => {
      router.addRoute(item)
    })
  }
}
